{% extends "../base.html" %}

{% block head %}    
<link rel="stylesheet" type="text/css" href="{{handler.static_url}}/css/forum.css"> 
<script type="text/javascript" src="{{handler.static_url}}/js/forum.js"></script> 

<title>讨论分享 |  Stock+</title> 
{% end %}
{% block body %}  

<div class="container">  
<div class="panel-1"> 
<div class="forum-filter clearfix">
	<div class="clearfix"> 
		<ul id="category" class="category">  
			{% if current_cat is None %}
			<li onclick="categoryClicked(this);" class="active" value="0"><a href="/forum">全部</a></li>
			{% else %}
			<li onclick="categoryClicked(this);" value="0"><a href="/forum">全部</a></li>
			{% end %}
			{% for cat in forum['cats'] %}
				{% if cat['id'] == current_cat %}
				<li onclick="categoryClicked(this);" class="active" value="{{cat['id']}}"><a href="/forum?cid={{cat['id']}}">{{cat['name']}}</a></li>
				{% else %}
				<li onclick="categoryClicked(this);" value="{{cat['id']}}"><a href="/forum?cid={{cat['id']}}">{{cat['name']}}</a></li>
				{% end %}
			{% end %}
		</ul>   
	</div>   
	<div class="clearfix">
		<ul class="tabs forum"> 
			
			<li><a href="#">热门</a></li> 
			<li><a href="#">尚未回答</a></li>
			<li><a href="#">活跃</a></li>
			<li><a href="#">最新提问</a></li>
			<li class="active"><a href="#">最新回答</a></li> 
		</ul> 
	</div>
</div>   

<ul class="threads">
   {% for thread in threads %}
   {% set num = randrange(10) %}
	<li class="clearfix">  
		<div class="stat clearfix">
			<div class="c1">
				<span class="c2">
					<span class="num">715</span>
					<span class="word">投票</span>
					<span class="c3">
						<span class="num">37</span>
						<span class="word">回答</span>
					</span>
				</span>
				<span class="num">320 <span class="word2">浏览</span></span>
			</div>
			<div class="arrow"></div>
		</div>  
		
		<div class="body">
			<a class="title" target="_blank" href="/forum/thread/{{thread['_id']}}">{{thread['title']}}</a>
			<span class="summary"> {{thread['summary']}} </span>	
			{% if 'tags' in thread %}
			<ul class="tags clearfix">
				{% for tag in thread['tags'] %}
				<li><a href="#" class="tag">{{tag}}</a></li> 
				{% end %}
			</ul>
			{% end %}
			<div class="author">
				<a href="#"><img src="{{handler.static_url}}/img/{{num}}.jpg"></a>
				<span>
					<span><a href="#">{{thread['user']['name']}}</a></span>
					<span>{{time_fmt(thread['created_at'])}}</span>
				</span>
			</div>
		</div> 
	</li> 
{% end %}
</ul>  
<div class="more"><a href="#">更 多</a></div>

</div> <!-- end of panel-1 -->

<div class="panel-2"> 
	<div class="clearfix">
		<div class="caption">
			<h3>活跃会员 TOP20</h3> 
		</div> 
		<div class="image-list">  
			{% for i in range(20) %}
			{% set num = randrange(10) %}
			<div class="image-item">
				<div class="image32">
					<a href="#"><img src="{{handler.static_url}}/img/{{num}}.jpg"></a>
				</div>
				<div class="name"><a href="#">洪雷鸣</a></div>
			</div>
			{% end %} 
		</div>
	</div>

	<div class="clearfix">
		<div class="caption">
			<h3>相关标签</h3> 
		</div>  
		<ul class="tags">
			{% for i in range(20) %}
			{% set count = randrange(100) %}
			<li><a class="tag" href="#">广汇股份</a><span> × {{count}}</span></li> 
			{% end %}
		</ul> 
	</div>
	
	
</div>   

</div> 
{% end %}
